<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    protected $errorArr = [];

    public function setError($message)
    {
        array_push($this->errorArr, $message);
    }

    public function getError()
    {
        return $this->errorArr;
    }

    public function getErrorMsg()
    {
        $errorMsg = implode(',', $this->errorArr);
        return $errorMsg;
    }

    public function dumpError()
    {
        $arr = $this->getError();
        dd($arr);
    }
}
